How can I check the level of charge left in a battery?
Two things happens to batteries as they discharge. The open-circuit (unloaded) voltage goes down, but there is also internal resistance in the battery that goes up with increasing states of discharge.
Depending on the battery technology, the voltage may gradually slope off over time, or it may only dip a couple of tenths before suddenly giving out all at once. So generally you can tell the difference between a fully charged battery and a nearly dead one by measuring voltage, but it can be difficult to tell with partially discharged batteries.
The internal resistance is what really matters anyway. You can't measure it by sticking an ohm-meter on a battery, but you can infer it by measuring the battery voltage while it's under a load. You need a load appropriate for the battery voltage and current capability, so you might use an automotive incandescent bulb for a small 12V lead-acid battery, or an LED for a coin cell. Just something you'd typically expect the battery to be able to power. If you measure the voltage while the battery is powering the load, you get a much better indication of how charged it is.
I think the way a lot of commercial devices do it is with measuring the current coming out of the battery over time, known as "Coulomb Counting". If your battery holds 1000 mAh, and you measure 300mA being used for an hour, then you know there is 700mAh left in the battery, or 70%. Here's a page that talks about this method (along with the less accurate voltage-based method)
If you have a multimeter, set it to "voltage" mode by turning the knob until it says something like "V" for voltage. (If you have more than one mode with "V" in the name, just try all of them.) Then connect the black wire of the multimeter to the negative terminal of the battery and connect the red write of the multimeter to the positive terminal of the battery. The multimeter should tell you the voltage. You can then compare this to the expected voltage level of a fully charged battery.
If you have a microcontroller with an ADC, you should make a simple voltage divider circuit using a few resistors that in the 10-100kOhm range, and connect the output of the voltage divide to an ADC pin on your microcontroller.
The point of the voltage divider is to divide your battery's voltage down to a level that your microcontroller can read (typically 0-3.3V or 0-5V). If you are using a battery whose voltage is always in that range already, you don't need to use a voltage divide. Here's an explanation of voltage divider circuits: