We have tons of barn cats, but you have to get them spayed/neutered or else they WILL wonder off. We got all of our cats from ads in the newspaper saying 'FREE cats/kittens'. We have a heated office that they can stay in at night, but only one of our cats actually will come to the office at night, the others usually hang in the hayloft. We do have a kitty door that's connected to the restroom door, which is also heated. I'm sure the cats that don't go in the office will go in there at some point during the night. We have water and dry food that we leave in the office and restroom for them. Don't leave cat food it out in the barn. We found out the hard way it doesn't only attract cats.
We haven't had a barn dog for years, but Ralph, our old rottweiler/german shepard/wolf/mastiff/whatever who wouldn't hurt a fly, did scare off MANY people. So maybe choosing a unscary dog breed would be an idea if you have a lot of people coming in and out. But then again if you want to make sure unwanted people stay out of the barn it might be good idea. Ralph never chased the horses, he thought sleeping in the very first stall was just fine. He stayed at the manager's house at night which was onsite.
I'll try and get a pic of Ozzy soon (the cat who comes in the office at night). :)