I think the key is to know what the prices are at the grocery store, vs. what the prices are at Sam's/Costco, and only go when it makes sense to go.
We joined Costco, but honestly, I think it's probably not worth us renewing; we only go maybe 3 or 4 times per year, and its a 40 min drive away from everything else we do/everywhere else we go, so lose on gas. If it were closer or we could combine trips with something else, it would be worth it to renew. We did buy our two, really nice, good quality baby gates from Costco, which we could only do as members, and so that probably did save us money.
However, with Costco, you do get coupon books monthly, and with those, I think that if you did buy diapers and other stuff you could save money over and above the cost of the membership fee, with the size of your family and the food/diaper/wipes thing. They have diapers and wipes about every other month on sale, it seems like, plus other stuff, like multi-packs of toothbrushes, canned goods, vitamins, and all kinds of other coupons. Also, according to DH, Costco has really good deals on eyeglasses--you just need to tell your opthamologist that you're getting your prescription filled elsewhere and then get him/her to write it out & take it to Costco.
We do buy bulk food through GFS (Gordon Food Services), and have definitely saved money doing that. Not all the items are less expensive (I never buy produce there; it's cheaper if you get it on sale/in season at the grocery store. They don't have much non-food stuff, besides catering stuff, but they do have generally good prices on many food things.
I am thinking about going with Sam's since there's one much closer (10 min, and right near another area we regularly go). But I have a lot of guilt over it---Sam's is owned and run by the same people as Walmart, and they have a terrible business rep, in terms of how they treat employees (Walmart actively encourages its employees to sign up for government assistance/health care/Medicare, which often they do qualify for, because Wmt doesn't pay a really wage that a person can live off of). In comparison, Costco is a more socially responsible company, and people love working there (seriously, they do); workers earn real living wages and they have good benefits for their employees.