You're making a fundamental, and common mistake, in asking such a question.
It's like asking "Sand dunes - what's the use?"
Your question is predicated upon the assumption that the existance, development, evolution of an organism has some kind of
goal or
purpose in mind. This is entirely untrue. Organisms evolve to fill ecological and environmental niches.
You will find that all flies are members of the order Diptera, one of the four largest orders of life (with over 150,000 known species). The only areas on Earth where flies are not naturally occuring are the artic and antartic poles. If you are particularly interested in flies, check out
http://www.inhs.uiuc.edu/cee/FLYTREE/.
Now back to the question at hand. What are flies good for? Well, on a basic level, they are "useful" for the transmission of their own genes; a fundamental attribute common to all known living organisms (and virii, if you choose not to clasify a virus as living). You specifically mention you didn't ask "what good are flies to humans?", so that's about as accurate an answer as you'll get.
What "good" are clouds?
What "good" are humans? :-)
Mr Mephisto