When a new iPhone switches on, all it will do is talk to iTunes, and all iTunes will do it try to sign it up to AT&T (well, assuming it's a US iPhone). Don't click anything; just run up a copy of ZiPhone and press the “Do it all!” button. 5 minutes later, you're all set. Your iPhone is now unlocked (it'll work with any SIM card/phone company) and jailbroken (you can install non-Apple-provided applications and fixes).
If you manage to do something bad to your phone (cough like changing the root password on version 1.1.3, perhaps … not as if I'm admitting anything), you need to regain control from iTunes first.
You should now be in Recovery mode. You should be able to ask iTunes to restore the phone to the current version (in my case, that represented an upgrade from 1.1.3 to 1.1.4) – this will trigger a download from Apple, ≅ 160MB. When this has been applied, the phone will reboot, and can now be re-hacked with ZiPhone.