I have now been back and forth from Iraq with my iPhone. AT&T installed my sim and activated the iPhone here. That's the only way to get any use out of it other than 911 as it has to Activate on the network (w/o that you can't even access the home screen). Also when you first plug it in to iTunes it will activate and update the firmware if needed.
You *should* be able to plug it in there in Iraq and it will activate/update over itunes as long as you have an internet connection on your laptop (MWR, HajiNet, Sniper Hills, etc) and AT&T has not suspended your account (Deployed soliders can suspend their accounts thereby saving the monthly fee while deployed). Then when you return to the US it will work as soon as you turn it on.
You really do want it activated before you receive it. There is a mode in settings called "Airplane Mode" which turns off the phone and other transmitters (wifi, et al). You can re-enable wifi by turning it back on from the toggle in settings without turning the phone back on. This will give you what basically amounts to an ipod Touch. You can access your ipod, apps, etc on the iphone without having to worry about unintentional phone/data connections (its 2.35/min for phone in Iraq BTW).
When you touch foot on US soil, just flip the Airplane mode off, give it a sec to connect to the network and you are good.
Should the phone come not activated, when you touch US soil call the AT&T service center (I had my wife do this since she had the account #, etc) and it will take about 5 minutes to "turn the phone on." Most of that is just waiting on the network to find the phone and activate it again. I literally did this sitting in the Dallas USO talking to my wife via Yahoo IM. She called AT&T and about a minute after setting up the account over the phone (i needed a new plan), my phone was active, my number turned back on, and data was available. It was pretty painless. Just make sure the phone is charged..lol
Anyway, if you want to talk to me further just hit me up. Preferably via the contact page at the URL below as I don't get much chance to check the forums anymore since net is so slow in Iraq.