I did not try any of these, but the are supposed to work on the iPhone (some maybe AT&T specific), use at your own risks:

CodeComment
*#0*#various diag
*#06#This displays the International Mobile Equipment Identity (IMEI) - the unique ID code for each phone.
*#21# CallThis displays various Call Forwarding settings.
*#30# CallThis displays whether or not your iPhone will display caller ID or numbers for incoming calls.
*#33# CallThis displays whether Call Blocking is enabled for outgoing calls.
*#43# CallThis displays the status of Call Waiting.
*#61# CallThis displays the total number of calls forwarded to voicemail when the phone was unanswered.
*#62# CallThis displays the total number of calls forwarded to voicemail when the phone was powered off or outside the service area.
*#67# CallThis displays the total number of calls forwarded to voicemail when the phone was busy.
*225# CallThis displays the current monthly balance.
*646# CallThis displays the remaining monthly minutes.
*777# CallThis displays the pre-paid account balance.
*#3001#12345 CallThis activates Field Test Mode, which reveals tons of hidden settings and data for the iPhone and network. These values should not be changed unless you know exactly what you’re doing.