You will need a digital single lens reflex (SLR) camera with an interchangeable lens, some black card stock, a pin, black tape, scissors, and a way to replace the lens with a piece of black card stock with a pin hole in it.
You could just take off the lens and tape the card with the hole over the lens mount, but I wouldnt recommend this, as it provides lots of opportunity to get dust and stuff into the camera. Instead I've devised two ways to quick-mount the card with the hole onto the camera thus minimizing opportunities for dust to get to the sensor.
The first is to make the pinhole in a body cap that fits your camera. It would be hard to get this right the first time, and stocking up on body caps is a bit of a pain, so I drilled a 5/16" hole in the body cap, and then taped the actual card with the pinhole over the hole in the body cap. Because the pinhole is mounted quite close to the camera's focal plane, it results in a fairly wide angle image.
The second way is to use a set of bellows to mount the card onto, and then onto the camera. I picked up a new, non-original equipment set of bellows off eBay for about $50. The bellows bayonets onto the camera, and provides a simple way to mount the card when the bellows is not on the camera. This results in a longer focal length, but with the bellows you now end up with a zoom pin hole camera, which is not something you see every day.
Step 1: Making the Pinhole
Someone commented that the thicker the card, the fuzzier the image, so use the thinest piece of black card you can find. You could also try tinfoil which is very thin and could result in a sharper image.
Step 2: Mounting the Pinhole to the Body Cap
Tape the card with the pinhole onto the cap, so that the pinhole is centered over the hole you drilled in the cap. Be sure that the card is tightly secured to the body cap so that no light is leaking in around the edges.
The first photo is the body cap before it was drilled out, the second is with a hole in the centre, and the third is with the card with the pinhole mounted so the pinhole is centered over the hole in the cap.
Step 3: Mounting the Pinhole
If you've mounted the pinhole onto a body cap, all you have to do is bayonet the body cap onto the bellows and you're ready to go.
Step 4: Attach to the Camera
Step 5: Take Some Photographs!
For my set up, bright sunlit images usually required about a 12 second exposure, but you'll have to run some tests to see what's right for your pinhole and your camera. Thanks to brightest_cyan for reminding me that you should cover the eyepiece on your camera, because light can leak in during long exposures and degrade the image.
I had my camera set for manual operation so I could adjust the shutter speed rather than having the light meter trying to guess.
The first illustration is indoors, with lots of light, and a 90 second exposure. The rest are outdoors in the last moments of bright sun before the rains came. The first two outdoors shots did not have the eyepiece covered, while the last two images did have the eyepiece covered - notice the difference.