Open iTunes and switch to the Applications section of the sidebar. If this section isn't in the sidebar, go to iTunes preferences and click the checkbox for Applications in the General tab. Pick the app you want, Control-click on it, and select the convenient Show in Finder option from the pop-up menu.
I'm going to say this before the next step, just to emphasize it: Make a copy of the app you are going to work with! That way, if something goes wrong, you won't lose the original.
Control-click on the application in the Finder and choose Copy from the contextual menu. Switch to another folder and paste (Command-V) the copy. Once the copy is fully there (sometimes apps take a little while to copy), you'll need to decompress it. For this, you'll need Stuffit Expander or similar. Once that's installed, Control-click on the copied app and use Open With in the contextual menu to expand the file.
Delve into the folder that was just created, and open the Payload folder within that folder. You should see an app icon with a crossed circle over it -- don't open this! Instead, Control-click on it and choose Show Package Contents from the pop-up menu. Congratulations! You've made it in!
From there, simply browse around in the contained files and folders until you find what you want, and copy it to a separate folder elsewhere. It's best to Quick Look everything if you're a Leopard user.
Once you've found everything you need, return to where you were before you opened the app's unpackaged contents folder. Close anything that could be viewing, playing, or doing anything to the files inside (probably more bothersome for Tiger users). Drag both the copy of the application and its Contents folder to the Trash, and empty it. Doing this is recommended because some iPhone applications are quite large, and making a copy of one and unzipping its contents to a folder just tripled the amount of space it was taking up on your hard disk.
Many of the files inside the app's contents will be completely useless to you, as they cannot be read without certain means. All that you will likely want are audio files (.m4a, .mp4, .wav, .mp3, and sometimes others like .ogg), image files (.jpg, .png, .bmp, .tiff, ect.), and movie files (usually .mov, but they can come in other flavors too). As I said, if you can, Quick Look everything.
[robg adds: Note that all of the content within any given application is obviously copyrighted by the creators of the application (and/or Apple), so anything beyond personal use of the content you may find is probably a copyright violation, depending on the laws of your country. Still, digging around inside an iPhone application isn't any different than digging around inside an OS X application to find, for instance, new alert sounds for Mail, etc. Just don't go posting the files for others to use!]

