I agree with all the advice for the most part ... little reaction, not saying "bad words" around them ...
With that said, my daughter (now 5, this probably won't apply to you right now) is allowed to use bad words AT HOME ONLY. She did use one word outside of the house and is no longer allowed to use that word anywhere. I've met very few people who don't ever swear, so I know my daughter will eventually do it anyway. Now, I can teach her when, where and how to use the words so that she doesn't sound like an "ugly" person. Plus, it takes away the "forbidden" so she doesn't have this desire to use those words for reaction.
My mom used to think I was putting too much pressure on my daughter, that she couldn't understand the concept, but in life, there are rules for different places and she understood that immediately. For instance, when on the playground, kids can run, be loud ... but you can't do that in a library.
When I tell friends of how we do things, they are always surprised because they never hear my daughter saying bad words ... and actually, she now rarely says them at home. She also corrects my husband when he says the one word she's not allowed to use (because we banned it for all of us) LOL.
Good luck!