Before you connect your iPhone or iTouch to iTunes.
Try and put the device into DFU Mode.
Plug your USB cord into your Device and Not into your computer.
Turn the Phone all the way off by holding the power button until the Red Bar appears and Slide it off..
Hold the "Home" Button Down for 5 seconds.
Then Push and Hold the "Power" Button while still holding the "Home" button and count to 7
Let go of the "Power" button while still holding the "Home" Button and Hold the Home button for approx 26 seconds.
The screen may or may not go blank with lines. No Worries!! now plug the USB into the computer with iTunes open. If the iphone is in DFU mode, iTunes will come up with a popup that says, "Itunes has detected an iPhone that is in recovery mode. Your must restore it"
Once this occurs, you can restore your device with any firmware by pressing "SHIFT" on your keyboard and "Clicking" Restore with your Mouse. Restore your device and let it mount to itunes.
If you are unlocking the device, I would suggest using "QuickPwn" you can get it HERE
You can download Apple iPhone Firmware HERE
, when using quickpwn you will need to upgrade your firmware to 1,2_ 2.2_5G77...NOT 2.2.1
(TIP: Don't restore your iphone with custom firmware in iTunes. Restore with the original Firmware and Unlock or Jailbreak letting Quickpwn make the custom firmware....Also if you have a 3G do not ungrade in itunes to the 2.2.1 firmware, it changes the phone modem baseband and renders it "NOT" unlockable)