Flies are attracted to a food supply, which means you have probably given them access to food either today or in the past. If you've given them access to food in the past, they may have laid eggs near the food supply, which have now moved into the fly stage. You should also check around your home for dead animals. For instance, if you have a dead mouse or rat in your attic, that will attract flies, then maggots, followed by flies again.