Those are fungus gnat larvae, and yes they eat the roots of your plant. Have you noticed any gnats or tiny annoying flies flying around? If you see one, kill it so it can't lay any more eggs.
Letting the soil dry out won't solve the problem completely, as the eggs that are already in the soil will just lie dormant until the soil is moist enough and then they'll hatch and the problem will start all over again.
I've had marginal success with ground cinnamon sprinkled on the soil, and watering with a diluted mixture of skim milk and water (must be skim milk!! not 1% or 2% 20 parts water to 1 part milk), as well as some hanging fly paper and letting the soil dry out completely between waterings. Why the cinnamon and milk works, I can only speculate, but it DOES work and beats paying $15 for some chemical spray that might kill the plants.
I'd pick up some new soil and transplant those babies if I were you. Fungus gnats thrive in soil that's rich in peat or sphagnum, so if you're growing in a medium that's mossy avoid overwatering at all costs. Or you could always grow in something that doesn't contain moss.