Possible to mirror iPhone/iPad screen on a monitor without jailbreaking?
http://code.google.com/p/iphoneos-screen-mirroring/ Has code to allow you to mirror your screen using the cables mentioned above. This code uses private apis so make sure you don't ship with it. This can be done by creating a new target in xcode and conditionally compiling the mirroring code in.
Since iPad 2 "The Apple VGA Adapter mirrors exactly what you see on iPad 2 so that everyone in the room can enjoy it." Same hardware that needs special coding on original iPad then on iPad 2 by default mirrors.
Check Apple Composite AV Cable and Apple Component AV Cable. These connect to a TV and computer so may be you can find a way to get it on a projector.
The iPhone 4 supports the VGA adapter that launched with the iPad. Within your application, any external display appears as an additional UIScreen instance. You can create a UIWindow, associate it with the UIScreen, and place content there that you would like to have displayed on the secondary monitor.
I show how to do this in the video for the iPad session of my course on iTunes U, and provide some code for this in the course notes. Matt Gemmell also has a nice writeup on the subject.