navX-MXP includes a number of
Java examples for RoboRIO that show how to use it for several uses including Field-Centric Drive, Rotate-to-Angle and Straight-line Driving as well as others. It mounts directly onto the RoboRIO's MXP slot so it's simple to install as well as use. And it comes w/some great tools including a UI that runs on the PC so students can quickly see how its various features work. There's also STL files available for an enclosure that protects it when mounted on the RoboRIO, so you can print that yourself or order that from Shapeways. So it's easy to get this up and running in short order.
If you do want to "roll your own" IMU using the RIODuino and an Invensense MPU-6050, you might want to look at the
nav6 source code. The nav6 is the precursor to the navX-MXP, and features an Arudino w/a MPU-6050 6-aixs IMU on it. If you had a shield or a breakout board w/a MPU-6050 on it that could connect the MPU's interrupt pin on it to one of the RIODuino pins, you could adapt the firmware to work. The nav6 used a UART to connect to the CRio, so you could use the same technique to communicate w/your Java robot application on the RoboRIO. Taking this on would be a very educational project, probably best reserved for off-season or for teams w/sufficient resources.