Since I keep forgetting how I’ve done this if something happens and I have to redo it, I’m posting it here to remind me. I have a PC with a LAN connection to my ADSL2+ modem and a WiFi card inside the PC sharing out WiFi to my iPhone and visitors. The connection is best set up as "Connect to PC to PC Ad-Hoc networks".
Set up your SHARED+WEP ad-hoc Wifi connection:
.gif)

The thing I kept forgetting is to SHARE my LAN connection which goes to my ADSL2+ modem.

.gif)
The circled option is the main point. Without this, your iPhone will not get an IP Address (as shown in the iPhone screenshot above). This was driving me crazy trying to figure out why it had a ‘169′ address. 169 means the DHCP didn’t work.
You will find out, if you use something like Air Sharing on your iPhone, that the iPhone IP Address changed a very large number of times. I think possibly when it goes into screensaver mode it gives up the IP. When you try the Wifi next it gets yet another IP Address.
Note that from what I can work out Ad-Hoc networks can ONLY be encrypted with the easily-breakable WEP encryption method. But, something is better than nothing, right? You need to chuck on a 5 letter password anyway, so without that it’s a bit harder for the Average Joe.
The only issue I find is from time to time my Windows PC will pause a second or two when browsing webpages while the Wifi connection is enabled. If I disable the Wifi while not using it, my web browsing is instantaneous. However, when I try to re-enable the Wifi while the PC is on I get an error ‘10′ cannot start and I have to reboot the PC.