Nasty little soft flies.......They live in the sludge build-up in sewer pipes..........Often the pipes themselves have breaks or openings allowing easy breeding access.........
Controls include cleaning the pipes with those foaming drain cleaners........Roto cleaning......and repairing any open access.........Professional pest exterminators have a "birth-control" available that is effective........