Can you tell me what you want to study (aka your question)? Is it an explorative study or do want to answer a particular question? For both I would recommend using culture-independent methods as carried out in the following papers (all from the excellent Drake and Horn lab):
http://dx.doi.org/10.1038/ismej.2014.262
http://dx.doi.org/10.1038/ismej.2010.99
http://dx.doi.org/10.1128/AEM.69.3.1662-1669.2003
You might also want to read the review article by Drake and Horn from 2007:
While the new "microbiome" techniques (ex. NGS, pyrosequencing) are very helpful as recommended by Dr. Dietrich, I do have two suggestions: First, these techniques may miss some of bacteria that are in endospore form when sampled; Second, if you use cultural methods you are able to monitor specific bacteria more easily and quickly see changes if you are changing the worms habitat. The two work together well depending on the type of study you are doing. Sampling "castings" of earthworms is easy if they deposit them above ground, but those leaving them within organic layers are harder. You may put the worms in a clean container, and see if they leave any deposits as they crawl. Sacrificing the worms, and aseptically dissecting out the intestines will give you less contaminated results.