Are you trying to sync your iTunes on your Mac onto the iPhone?
If so can you tell us what type of iPhone you have and what version of iTunes you are using?
When you plug your iPhone into your Mac does it show up on the left hand toolbar of your Itunes window?
When you connect the phone does the display change if you leave it alone for a minute or so?
Does it show a charge display, a sync page or just the normal slide to unlock message?
Also what type of iMac do you have, Is it a newer flat panel machine or an older rounded base machine?
Can you tell me if you are connecting the iPhone directly to the USB ports on the back of the machine or are you using firewire or a USB hub?
Also can you tell me if your iPhone has ever connected to your machine?
So you can verify you are using the USB ports not firewire and can you also let me know if your iPhone has ever connected to your mac?
In that case with the phone unplugged can you first press and hold down the Home (bottom center) and power buttons (Top Right) on the iPhone for a full 15 seconds, During that time the phone should power off then come on and then power off again.
Once it has powered off the second time can you then wait about 5 seconds then press the power button for 2 seconds and let the phone power up all the way to the desktop.
Once up to the desktop can you then try to connect it to your Mac again then wait 30 seconds and let me know if it beeps or changes the display.
Did iTunes open by itself when you connected the iPhone?
If you already had iTunes open can you disconnect the iPhone and listen for the chirup/beep then close iTunes and wait 30 seconds then try connecting your iPhone to a different USB port an let me know if it then beeps and opens iTunes within approx 2 minutes.
Can you disconnect your iPhone then shut down your Mac, Once it has turned off can you wait 20 seconds then power it back up, As soon as you let go of the power button can you press and hold down the SHIFT key and keep it held till you see the load icon appear under the Apple logo then let go and wait approx 5-10 minutes for your amc to Safe Boot.
Once the machas Safe Booted can you just restart like normal then let the machine open all the way up and try connecting your iPhone again then let m eknow what happens.