Making accelerometer sense nonconventional gravity
Each accelerometer (when stationary) gives you a 3 vector for the direction of gravity. 

Let's assume that both accelerometers are offset-free, and have the same gain on all three axes. If they are not that ideal, then it's fairly easy to obtain an offset and gain for each axis with a calibration step that involves rolling each to a large number of random angles, and deriving offsets and gains such that the magnitude of gravity (sqrt(sum of squared components)) is constant regardless of the accelerometer orientation.

The angle between two 3 vectors is now calculated via their dot (or scalar) product, which gives you the cosine of that angle. See wikipedia dot product for full details.