GLMotion is a project mainly written in C and OBJECTIVE-C, it's free.
Update Apple's GLGravity demo to use Core Motion on iPhone 4