The general rule, says Peggy Post, an expert on manners, is that if children are not specifically invited they should be left at home.
Given the difficulties parents can face in doing that, however, it's fine to ask politely, "Is this invitation adults only, or are the children invited?" Or if that seems too forthright, say, "We'd love to come, but I have to see if I can get can get a sitter."
The person extending an invitation to a dinner party can gently encourage adults-only by asking, "Do you think you could get a sitter for Saturday night so that you and Jim could come to dinner?"
Once people show up with their children, there's only one thing to do, take them in graciously. To the degree possible, it's nice to provide them with some diversions (a video, or simple toys), but the responsibility for the behavior and entertainment of children really falls to the visiting parents.
The hosts can correct a child for breaching house rules, but should not involve themselves in general discipline.
When appropriate, hosts should remove breakable objects from harm's way ahead of time.
If children are coming for dinner, common sense dictates whether or not to set up a separate table for them. If everyone eats together, after dinner children can be excused from the table early.