Even if you are not a registered iPhone developer of Apple (US$99 program), you still can code and test your iPhone program in firmware 2.0
This is how:
(1) You need a machine running Mac OS X 10.5.2 with Intel CPU because you need to run iPhone SDK for the iPhone OS 2.0
there are several possibilities, e.g.
(a) you can get a Intel Mac with Mac OS X 10.5.2 (which I think is the easiest one and save a lot of troubles, thus you can put omore time in the learning of iPhone programming)
(b) Use the VMWare image (and use VMWare Workstation/Player for PC), read this, and install iPhone SDK in it. You need C2D Intel CPU and lots of RAM (2G) in your existing PC.
(c) Install OSX86 on PC (you must be a power user), read this forum on how http://www.hackint0sh.org/forum/forumdisplay.php?f=104
(2) Get the iPhone SDK from Apple which is free after registration with Apple.
(3) You need to read some books on Objective C and Foundation framework of Mac OS X, I think Oreilly has good source of books in this subject. This site also gives some tutorial exmaples on cocoa programming http://cocoadevcentral.com/
(4) Get a pwned iPhone with iPhone OS 2.0 firmware beta 3 (build 5A240d)
read this for the pwnage tools http://www.hackint0sh.org/forum/forumdisplay.php?f=146
(5) Read this Forum and use the Xcode template (open toolchain header) here to start some coding and testing on iPhone
(6) get some project code (based on open toolchain) from the right menu of this blog to compile and test run on iPhone
(7) start coding your own idea in your own iPhone project.