Given your interest in the kalman filter, perhaps you intend to augment GPS data with inertial measurements. About your question:
"How would I go about coding a filter
to use the accelerometer readings to
calibrate the gyro at times when the
system is tilted so the gyro axis is
not collinear with gravity, and is
being rotated about the gyro axis? It
seems like there should be enough
information to do that"
This sounds like a gyrocompasing alignment. Assuming you are doing a factory calibration, and have the unit on a bench, you will be able to independently measure the alignment. Then run the leveling code you will write and back out the gyro bias error from the difference between the measure and gyrocompased alignments.
If you want to update gyro drift on-the fly, then you will need the kalman filter.
As far as implementation goes I recommend Chapter 7, GPS and Inertial Integration of Global Position System Theory and Applications vol 2 has excellent background on the topic. It has the theory and math, but no source code.