http://www.sciencedaily.com/releases/2008/03/080303190535.htm Scientists have just figured out that riboflavin is the key ingredient to help bacteria that eat waste to generate electricity.
Basically, they cultured some bacteria colonies around electrodes, and then when they upped the riboflavin concentration of the bacteria's diet, electricity production went through the roof. Riboflavin (vitamin b-12) has some magical properties that let it act as a conduit between living cells and electrodes. Cool!
In theory, wastewater treatment facilities could go energy-neutral by letting the bacteria treat the
water and generate power for the facility simultaneously.
To get it to a point where your home
compost pile is generating power is going to require a few more significant advances, but it certainly is interesting considering the possibilities!