Step 1: The raw materials
1. A webcam with an unscrewable lens (I got a really cheap one for about £5 on ebay)
It is absolutely vital the webcam has an unscrewable lens, almost all do (and for most webcams this is actually the way you focus!).
Step 2: Dissasembling the webcam
Step 3: Reassembling the webcam
Step 4: Using the super-macro/microscope webcam
If you want to "zoom in" (increase the magnification) you have to move the lens further away from the sensor. The simplist way to do this is with a tube of paper or card stuck into the webcam body which you can put the lens in. Again, be careful with light leaks - black card or paper covered in tin-foil will be very good at blocking stray light.
Step 5: Measuring performance
Take a picture of the pixels of your screen, then open the captured image in some photo-editing software. Measure how wide the image of one pixel is (in pixels), this is the magnification factor.
You can also calculate how big the field of view of the webcam image is from the ppi of your screen:
(25.4 / dpi) * n = fov
ppi is the "pixels per inch" of your screen, commonly 72.
n is the number of pixels that fit across the captured image.
fov is the field of view, measured in millimetres.
I have attached an example image from my modified webcam. Here the image of a single pixel is 130px across so the magnification factor is 130x. It is a picture of a 72ppi screen and 5 pixels fit across the image so the field of view is about 1.75mm!
Step 6: Some fun pictures
The images are of the edge of a 5p coin, the pixels on my camera's display and some paper!