Thanks for writing. The flying insects are probably attracted to the decomposing organic matter. While they're annoying, they may actually be helping --- a variety of bacteria, insects, and other living things help your compost decompose more quickly.
If they're too annoying to live with, try adding more brown, carbon-rich materials (such as weed-free straw or dried leaves). That may help bring your pile into better balance so it's less attractive to the type of flying insect you're seeing.
---Justin, Senior Garden Editor, BHG.com "