To make the microscope, I started with a Logitech C310 HD Webcam and a 9-LED flashlight.
First, I removed the center LED and drilled out the center of the flashlight PCB to fit around the webcam lens. I had to remove the plastic edges around the lens to make it all the same diameter.
Then I found the +5 and ground wires from the USB cable and added a short length of cable to power the LEDs. I added a 100 ohm resistor on each side of the LED power cable and soldered the other ends to the LED pcb. You may want to add a switch to the LEDs for on/off control. Mine is on whenever it is plugged into the USB port.
Adjusting the lens outward turns the webcam into a microscope. Here's a few pics of a penny with different lens adjustments.