I saw many examples about filtering Accelermeter\'s values, to cancel out the gravity (High-pass filter).
But most of them were 1st order one, which is said to be simple
the DSP Guide is what you're looking for. It gives the basic 'theory' as well as mathematics behind Digital Signal Processing and the works.
http://www.dspguide.com/ch14.htm That is a good starting point
Check it out.
And from personal experience, a 1st order filter will be 'good' enough for most simple applications. Though this completely depends on the specific application