There are lots of different types that do different things. By flies do you mean fungus gnats?
I used to buy nematodes for that, but they are kind of expensive and don't last as long as bacteria that achieves the same job. What I use now is bacillus thuringiensis israelensis there is a product called 'mosquitos bits' (because you can also use it to kill mosquitos) that stores much better and in theory you could grow that bacteria out quite easily, but I find a bag of that goes a long way anyway.