I just read this amazing blog post by a mom who recently lost her baby. She gives real, practical examples of what to do/say to someone who has lost a baby. I think it's well worth a read and most of her advice applies to ANY loss, not just a baby.
I had 2 ectopic pregnancies before Paula was conceived and it was hard, because so often people just said... nothing, or mentioned my surgery, but not the reason for it - "how are you feeling after your op?" By not acknowledging my loss, they made it seem as though I hadn't suffered a loss, so I had to carry my grief alone.
After Craig died, while some of our friends were AMAZING, there were others that avoided us at all costs (in one case actually crossing a road to avoid having to greet me!), or else carried on like nothing had happened, and it hurt. It made it seem as though his life had no value in their eyes.
Dealing with grief is difficult and uncomfortable, yet sooner or later we all have to do it, so I think any bit of advice is helpful.