Before doing anything, back up your device. In iTunes, you can force a backup by selecting it in the DEVICES section of the iTunes source list. Right-click (or Control-click) the device, choose Back Up and let iTunes do its job.
Your device backups are stored in your home library, namely in /Users/your-account/Library/Application Support/MobileSync/Backup.
To gain access to these backups, copy this folder onto your new computer, making sure that it's stored in the right place. You may need to create the MobileSync subfolder in the Application Support folder in your home library.
You also want to grab the MobileDevice preferences folder and copy it over to the new machine.
Next, make sure to copy over your iTunes folder in full -- it's normally found in your home Music folder and contains your iTunes library.
[If you're using Apple's Migration Assistant, all of these files should be copied for you if you include Music and Settings in your migrated items.]
From there, everything should automagically just work.
If it doesn't, of course, you've got the backups to work with. After synchronizing to the new computer, you can restore your iPhone to its previous state by selecting it in iTunes. Right-click (or Control-click) the device, choose "Restore from Backup" from the contextual pop-up menu, and select the backup you want to restore from. iTunes automatically offers all backups found in the MobileSync folder.
Uncle Victor, TUAW's beloved ruler, recently went through this and found that copying over iTunes' Music folder, the MobileDevice prefs and the backup folders worked like a charm for him.
Congrats on your new iMac!