I found good articles about the use of accelerometers and gyroscopes in navigation on this blog. The part on Kalman filtering is a bit hazy, but there seems to be code samples.
You will also find general resources on Kalman filtering at http://academic.csuohio.edu/simond/publications.html. The article referred in (8) is a good, not too scary, introduction to the mathematics behind Kalman filters.