J., most importantly, please don't let your daughter believe that it's "okay" to be run over by the whims and bad behavior of others. Don't let her under-value herself by believing that she must tolerate rudeness just because she's lonely -- no, ESPECIALLY because she's lonely. That loneliness makes her very vulnerable.
Ordinarily, I'd say that a child her age should take some responsibility for her guests, but in this case I think you will need to establish your own authority before that can become a reasonable expectation. You are the ADULT, and right now, your daughter must feel very helpless to manage this situation. If you can't control these boys, how can she expect to do it?
Start by locking the front door. Well-bred people do not barge into each other's houses, even if they are best friends. (and frankly, regardless of how rural your neighborhood may be, it isn't safe to leave the door unlocked -- most suburban crimes are crimes of opportunity, and there's no need to invite that).
If these boys attempt to help themselves to a snack, you need to stop them. You don't have to be the wicked witch here, just stop them and explain that if they'd like a snack, they need to ask first. YOU tell them whether they may or may not have a snack, and if so, what is available, where they may eat it, etc. If they ignore you, or you catch them running by with contraband popsicles or whatever, send them home. Truly, that doesn't even count as "discipline".
Again, you don't have to be a jerk. You can keep your tone light but be firm: "Excuse me...what is going on here? Does this look like a snack tree? Were you raised in a barn? At our house we ask for snacks or there are no snacks. Got it?" Once the rules are established, don't debate, just do it.
If they don't "get it", you need to have to a casual talk with the parents without any of the children present. Just tell them you've been having a "little issue", no big deal, but the boys have been doing X (helping themselves to snacks or whatever it is), and that's why you had to send them home. Chances are they'll be mortified, and will have a chat with their boys about manners.
Your daughter may be disappointed or sad to lose her playmates at that particular moment. But remember that you will be helping the boys to become better playmates in the future, and she will benefit from this. Again, above all, demonstrate to your daughter that expecting good behavior and manners isn't "mean" or "hurtful" -- it's what everyone deserves, and anything less is not an option.
You might also consider having the boys over one at a time...sometimes children do egg each other on, and children do tend to behave better alone, than in packs.
Outdoor Friends
A few years back, my daughter (also an only child, in a mostly childless neighborhood) had a friend who was a handful. She dumped out every toy in the playroom and refused to help clean up. She snuck food into parts of the house where it isn't allowed, turned on the TV when after I said "No TV", etc. Essentially, she was distrepectful to me, my daughter, and our home in general. She did NOT behave this way around her parents, who were very nice people and very strict. When I brought this to their attention, they were horrified, and insisted that I send her home whenever she acted this way. Now, my daughter did like this child, but eventually she suggested that we play with her "in the park" or in venues other than our home, which turned out to be a delightful compromise. "I think she's basically an outdoor-friend," my daughter told me.