An inertial navigation system is a really ambitious project, I'd love to see how it turns out. So, lets cover the basics, and forgive me for repeating some things I'm sure you already know:
So, a 3D compass is exactly what it sounds like. Picture a compass where the needle is free to tilt up and down as well as rotate left and right. There is a vertical component to the Earth's magnetic field, varying depending on where you are. Standing over the north magnetic pole, a 3D compass would point straight down towards your feet! There might be compasses that output virtual needle angles, but the ones I'm familiar with output the magnitude of the magnetic field in three perpendicular directions (X,Y,Z). The compass reading won't change as you move it around, except for when you rotate it, so a compass alone won't give you a complete record of motion, only of orientation.
Accelerometers and Gyroscopes are operate differently, although they sometimes come in the same package, so lets talk about them separately.
Digital gyroscopes tell you the rate that they are rotating (i.e. 10 degrees per second) about an axis. A 3D gyroscope will tell you the rate at which it is rotating about three axes, but it its up to you to integrate these readings (measure them very frequently, multiply by the time since the last reading, and add them all up to find how far you've rotated) to find the current relative orientation of your robot.
Accelerometers, as the name implies, measure acceleration. In a horizontal plane, an accelerometer that isn't moving, or that is moving with a constant speed will read zero. To find out how far an accelerometer has moved, you need to integrate the acceleration data twice, once to find the velocity of the accelerometer, then again to find it's position. Keep in mind this makes the assumption that the accelerometer is initially stationary!
The big problem is that accelerometers don't measure actual acceleration, they measure forces. Ideally these would all be inertial forces (the internal workings of the accelerometer tending to stay where they are as you try to move it around). The problem is that gravity also applies a force on the accelerometer, causing it to register a virtual downward acceleration, even when it isn't moving. To cancel this out, you have to know which way is down. This isn't a big problem if your robot is moving on a flat surface, but if your robot will be rotating as well as translating in three dimensions, you'll need gyros as well. Oddly enough, a 3D accelerometer will read zero when it is in freefall, and actually accelerating towards the earth!
Accelerometers and gyroscopes are frequently paired because they compliment each other. Gyroscopes can tell you how far you've rotated form a starting orientation, but have no way of knowing what that starting orientation was. A stationary accelerometer will tell you which way is down, but once it starts moving you need to know its orientation to get position data from it. So, guidance systems based on accelerometers and gyroscopes generally have a stationary initialization routine. You turn the system on, but leave it still for a while. The accelerometer tells you which way is down, so you can figure out the initial orientation of the robot (with respect to it's initial heading). This is also a good time to figure out the "steady state drift" of the gyroscope, the small, but nonzero reading that each axis will give when it's actually not rotating, to subtract out of later readings. As your robot moves, integrating the gyro readings will tell you your robot's new orientation (still, with respect to it's initial heading), and double integrating the accelerometer readings, taking into account the changing orientation will tell you it's position.
The big problem with inertial navigation is that it is prone to HUGE ERRORS. Accelerometer and gyroscope readings drift somewhat randomly over time, with changing temperatures, and for reasons you shouldn't even worry about like the rotation of the earth. These errors are magnified by integration (and double integration) and add up over time. A 3D compass is nice to have, because although it's not as precise (and doesn't work well indoors) it provides an absolute orientation reference, with an error that won't increase over time.
Anyway. I'm sure I've given you WAY too much information to process. As you can probably tell I've got a little interest in this subject my self, so please feel free to ask more questions or for clarification. Most of all good luck, and be sure to let us know how it turns out!