What's not to like about worms, really? Sure, they're slimy. And wriggly. And wet. And they creep around and curl up and die on the sidewalk when it rains. Other than that, though, they're lovable little creatures and all they really want out of life is a good pile of dirt and stuff to wriggle around in and turn into compost for you. Be nice to them and they'll save you lots of money in potting soil.
Keep It Cool
According to the "Rodale Book of Composting," most earthworms cannot tolerate the normal heat level of a compost pile that is working as it should be. So grabbing a handful of worms and throwing them in just means that soon you'll have a handful of dead worms. Instead of becoming a worm-killer, make a simple adjustment to your compost heap dimensions: spread it out longer and wider than your normal compost pile and keep it no more than 18 inches high. This will increase the surface area, which will keep the temperature cooler. The compost will still be composting, and the worms will be happy.
Get the Right Worms
Get to know your worms before you throw them in your compost heap. The kind you see crawling around are, most likely, either night crawlers or field worms. They're nice enough, but what you want are the manure-type worms which will tolerate higher temperatures and live happily in the middle of your compost. You want red worms (Lumbricus rubellus) or brandling worms (Eisenia foetida). Both are common commercially, often sold as bait worms or composting worms.
Use the Other Worms, Too
You can still make use of the night crawlers and field worms you find in yard and garden. Put them around the outer edge of the compost heap. They'll happily eat away at it, they just don't want to live there. Plop them down on that line between dirt and compost, and they'll do some munching, then burrow into earth when they need to get away.
Shred Things Up
When it comes to compost and labor, you can let the worms do it all or you can do a bit and speed things up. Consider the size of a worm's mouth: small. Now consider the size of a chipper-shredder: large. The more finely you shred up the material that goes into your compost, the sooner it will be consumed and excreted by your wormy workers.
Harvest by Half
The point of a compost heap, of course, is to get some compost which you can use in your yard and garden. There will come the day when you decide it's done, and with shovel and wheelbarrow you approach. This is fine, but if you want to keep some worms in the compost heap that you'll need to rebuild, leave half of it there. Remove either one entire side of the heap and spread the other side out to form a new base, or remove the top few inches of the heap, shovel out the really good, well-rotted stuff in the middle, and then cover the very bottom layer up with the top layer you already removed. The worms left behind will immediately start munching on their new top layer and you can go spread compost elsewhere.