iNdependence is a Cocoa-based application for Mac OS X which provides an easy-to-use interface for jailbreak, activation, SSH installation, and ringtone/wallpaper/application installation on your iPhone. It's open source under the GNU v2 license.
The source code for interacting with the iPhone has been broken out into a library (libPhoneInteraction) so that it can be easily reused by other applications. http://code.google.com/p/independence/