I've have this problem myself. I have 4 Rhode Island Reds and 5 Black Australorps and 8 Indian Runner Ducks. We clean their living quarters and run daily, fresh straw, clean kiddie pool, the works. But still with the flies. I finally had to resort to wiring a box fan to one of the windows for constant, steady breeze and attaching those Little Tree vanilla scented air-freshners to the fan to help with the gnats also.I also hang up the old fashioned fly tapes too and change them frequently. Here's a tip for that too... If you accidentley back up and get your hair stuck on one, use WD-40 to get hair off the trap then jump in the shower and wash the spots with Dawn dishsoap. You might smell like a mechanic for an hour or so, but you won't have to cut your hair! And yes, I did have to do this....
If you are not against using sprays, there are plenty of fly sprays at farm stores that are safe to use around dairy cows. We have found some before at our local FS station called Dairy-Ease fly & beetle spray. They also carry a brand at the local Farm King, but I can't remember the name of that one. I hope this helps!