Problems happen when the larvae consum the MLSS - which can cause loss of slower growing organisms such as Ammonia Oxidizing Bacteria (AOB). They can also create effluent TSS if they wash over the clarifier weir.
To control midge larvae, the EPA approves the use of Bacillus thuringensis (Bt) spore solutions (kill larvae by damanging their digestive tract) or Strike which is an insect growth regulator (similar to that used in pet flea/tick control).
Here is a bit more that I wrote on the midge problem in a previous post:
https://www.biologicalwasteexpert.com/blog/whats-eating-my-biomass-red-worms-blood-worms-midge-fly-larvae