I understand how telescope, microscope and glasses work.
But how do contact lenses work?
Your question is really "how does the human eye work?", since the contact lens is designed to adjust the optics of the human biological lens.
This image from the wikipedia article on the anatomical lens shows how the lens focuses incoming light from the left onto the retina (right).
You should imagine the contact lens being placed over the cornea (left surface) and causing the rays to adjust so that the image ends up in focus.
The thing that confused me at first about contact lenses was that they didn't look like "normal" lenses, in which each side of them curved in the opposite direction to each other.
As I understand them, contact lenses are Meniscus lenses - wherein the sides are curved in the same direction as each other, but more curved on one of the sides. You can see some examples here.
Contact lenses work in the same way as glasses, by adding or subtracting wavefront curvature. This basically adjusts where the focal point of light entering the eye is, glasses and contact lenses are designed to adjust it so that the focal point of the light lies on the retina.
The main differences I can see between glasses and contact lenses, is that the contact lens faces are both curving outwards like this (( rather than this () or this )( like traditional glasses. This is so that the lens can rest comfortably on the outside of the eye.
If we remember the laws of optics, we remember that the light is only affected by the changes in refractive indices, in the boundaries between air and glass for example. In normal glasses the two surfaces are air to glass and glass to air.
In contact lenses we have again two surfaces, but it's air to contact lens then contact lens to eye. Note I say contact lens not glass as contact lenses are made from a variety of materials. The focal point adjustment in a contact lens happens mostly at the outer boundary - the one between air and the contact lens.
The fact that the other surface is curved the 'wrong' way (for some types of lens requirements) means that it's effect must be calculated and compensated for by the outer surface.