There's an adapter available that help you run 2 monitors from the DVI on the MacBook Pro. It's not that great and kinda expensive (250$, it's actually a video card in a box).
The new iMacs use mini display port, you can get an adapter that get you DVI, but then again it's another 100$ to add to it.
If you want 3 monitors, the best you can get for that is the Mac Pro. The iMacs is a terrible choice for that. You should look into buying a old gen refurb, if you don't mind having old (8800GT) video cards.