The reason compound microscopes invert images lies in the focal length of the objective lens. The image focused by the lens crosses before the eyepiece further magnifies what the observer sees, and the objective lens inverts the image because of the lens' curvature. Digital microscopes that project images onto a screen correct for this problem, but laboratory-grade compound microscopes invert images, meaning they are upside down to the observer.
The inverted image is made from a positive lens, which means the image formed after light passes through the lens is a real image. This real image is inverted at the focal length. An example of this is using a letter of the alphabet. When the letter "e" is put right-side up in the slide to the observer, it is projected upside down in the tube. Moving the slide to the right shifts the image to the left, and vice versa.
A compound microscope is so called because there are multiple lenses magnifying images. Underneath the slide is a light source, then the stage upon which the slide sits. The image is refracted through the objective lens, and it travels up the body tube where the ocular lens magnifies the image a little more. The objective lens is where most of the magnification occurs, and many microscopes have rotating lenses that increase magnifications.