Let's say I want some songs from the imac and some from the ibook on the phone. Can it be done?
What about contacts? Can I sync contacs from both into one?
I don't have mac computers, but when I connected my iPhone from one PC to the other in order to sync music, just like a regular iPod, it says you may only sync with one computer. If you choose to sync from one computer to the other, you must remove the files on the iPhone first and then it will sync the files.

Definitely yes…connect either by cable or bluetooth
References :
I don't know if you can sync both, I had issues using two comps with my ipod.
You could always manually manage them!
References :
I don't have mac computers, but when I connected my iPhone from one PC to the other in order to sync music, just like a regular iPod, it says you may only sync with one computer. If you choose to sync from one computer to the other, you must remove the files on the iPhone first and then it will sync the files.
References :