Super Troopers, Billy Madison, and Office Space are three pretty funny movies that bombed. Fight Club is another one that didn't do well in the theater but is considered a classic. Grindhouse (Planet Terror/Death Proof) also did poorly in the box office but is a hell of a lot of fun to watch (especially the extended versions with the extra fake trailers). BTW, Machete is being made.
But the ultimate example is Blade Runner. Extremely good movie that gets better with repeated viewings. Released alongside E.T. and was totally overshadowed in the box office, IIRC.