Disclaimer: 1). I haven't tried this myself, 2). This guide is application for original iPhone, iPhone 3G running on firmware 3.0.
Unlocking and jailbreaking an iPhone can be intimedating and scary at times. While the iPhone Dev Team kicks ass in writing hacking software, they aren't always the best in documenting the process to free your iPhone or iPhone 3G. Gizmodo published a handy step-by-step guide to show you how it can be done. Personally, I found the two step (redsn0w via app + ultrasn0w via browser) combination a bit unique. Essentially, for this round, instead of jailbreaking AND unlocking your device at once, they break it up into two separate steps.
As always, there is no garantee it will work so take your time and good luck!