MAG3110 Magnetometer Hookup Guide
Resources and Going Further
This is a nifty little sensor for orientation, but you may want to go beyond the simple compass that this library allows. You can use an accelerometer in conjunction with this device to create a tilt-compensated compass. SparkFun has a variety of accelerometers available, including the ADXL345.
To get you started in the right direction, here are a few application notes that go into more detail about this:
You can also check out my project using this guide and the MAG3110, the Digital Compass.