Are you trying to build a 3D mouse program for the iPhone? (There are a few out there already.) Can you describe exactly what user motion you want to correspond to what action?
The easiest thing to do is to get the pitch of the device by taking the arc cosine of the dot product of the acceleration vector with (0, 0, 1000).
If you are trying to implement a device in which sliding the iPhone back and forth through space moves a pointer back and forth on a screen, that would be difficult because it would require relatively violent hand motions to produce accelerations that are large compared to gravitational acceleration. MEMS accelerometers like the one in the iPhone are great at measuring the direction of gravity but pretty poor at measuring actual accelerations of the device itself.
If you describe your application a little, I might be able to give you more specific pointers.
There are a number of different ways of representing spatial rotations, but quaternions are very popular in the game programming community. A Google search gives you some links to some primers. The GamaSutra one is a good place to start.
http://www.gamasutra.com/features/19980703/quaternions_01.htm
http://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation
http://www.flipcode.com/documents/matrfaq.html