There's a product that popped up a few years ago around here - made locally and within a very short time the whole area swears by it for warding off gnats. It isn't as effective with mosquitoes, but also somewhat works on them.

Don't know if it would work for black flies, but it is safe for dogs and I 100% recommend trying some.

http://simplysoothing.net/bug-soother/bug-soother-product/