The secret is to use "macro mode", a feature nearly all cameras have nowadays. It's intended to take closeup pictures of things only a few inches away from the lens, but since that's the apparent distance of what you see through a scope, it works for that as well.
Step 1: The standard icon representing macro mode usually involves a flower and sometimes the letters "MF" (for "macro focus").
Step 2: For quick-and-dirty work, you can use nothing more than your hand to hold the camera lens up to the eyepiece
Make a ring with your fingers keeping the lens and the eyepiece about a half-inch apart.
Step 3: Center and focus
Then look at the viewfinder LCD of your camera and you'll see a round blob of light that moves in the opposite direction from what you'd expect.
You want to keep things steady and try to center this blob. You'll probably find that you need to adjust the distance between the lens and the eyepiece a bit before your camera will be able to focus properly.
Step 4: Then take a picture
This creature was crawling around on a leaf in my front yard. Pretty frightening, especially if you are an oak tree.
You can, of course, crop the image to remove the black circle (which is called "vignetting", and is a side effect of not spending $100 on an actual lens adapter.)
Step 5: Use a tripod
After awhile, you'll find that keeping everything centered and steady is a fair bit of work, so if you want to take more than a few images, try using a tripod to maintain the lens-to-eyepiece distance for you.
Step 6: Make some videos
Since my digital camera will also take short videos, I was able to get moving pictures of the nasty oak-eating insect crawling around on a small screwdriver ...
Step 7: Telescopes and more
All of this will also work for taking pictures through a telescope, although you'll probably find that a tripod is more necessary for stability, and that many cameras will have trouble with dark subjects (like the night sky). It works well for terrestrial pictures in daylight.
Thanks to nospleen (Erich Brandeau) for taking pictures of me taking pictures.
(Instructables user davidmerrill used this technique to illustrate his wonderful explanation of how to hand solder SMT chips (http://www.instructables.com/ex/i/0E9564B43CE71029AC23001143E7E506/?ALLSTEPS). But the technique is so useful and little-known that I thought it deserved its own Instructable.)