I actually have both. Hubby gets a Sam's membership through his work and I have a Costco membership for my business.
They usually have somewhat different foods where I live.
Sams has better meat and a wider variety of drinks (juices, V8, etc.)
Costco has a huge dairy/specialty deli area (I can get Laughing Cow cheese, a huge block of Dubliner, and even Babybel) and has the organic wild frozen blueberries that I eat in my yogurt every morning.
Both of them are hit or miss on produce - sometimes it's great and sometimes not. I haven't tried the bakery goods at either.
Oh, and I prefer Sam's photo center to Costco's, but that's because I've been using Sam's longer and the lab manager knows me by name.
.