iRecovery is a libusb-based commandline utility for Mac OS X and Linux (perhaps Windows too). It is able to talk to the iBoot/iBSS in Apple's iPhone/iPod touch via USB.
It's completely open-source, the source-code is released under the terms of the GNU General Public License version 3. The full license text can be found in the LICENSE file on github.
It currently connects to 0x1281 (iPhone, iPhone 3G, iPod touch, iPod touch 2G: Recovery Mode/iBSS), 0x1227 (iPhone, iPhone 3G, iPod touch: WTF Mode; iPod touch 2G: DFU Mode).
DFU 2.0 (0x1227)
It can upload a file, such as an iBSS, so that you can unplug and spawn a shell with 0x1281.
Recovery 2.0 (0x1281)
You can upload a file to 0x9000000 with the following syntax:
./iRecovery -f file
You can spawn a shell to do all sorts of neat things with the syntax:
Once it has spawned, you can type 'help' and iBoot will respond with its built-in command list.
./iRecovery -c "command"
Sends a single command to the device *without* spawning a shell.