Hello to the writer of Miscarried: firstly, I am so, so sorry for your loss. I write as a woman who experienced second trimester miscarriage myself, and I want to offer you some of the resources that helped me.
Check out: www.miscarriageassociation.org.uk
As you will see from these resources, miscarriage is very common. Many, many women experience it. It is not your fault, it is not some kind of spiritual test, it is just a natural phenomenon. It is ok to feel they way you do, and you are NOT alone.
Some practical things you can do:
Honour your love for the baby you lost - since this baby is probably not buried in a cemetery you can visit, plant a lovely blossoming tree somewhere, and go there regularly to grieve. When you are there, know that that is your time to grieve, and don't be ashamed of your feelings.
Honour your own needs - people experience this kind of grief in many different ways, including loss of sexual confidence, anxiety and other signs of trauma. Try to articulate your feelings to your husband. If he finds this difficult to understand, refer him to the resources that show how common these reactions are, and how important for your healing it is that they are respected, and that you receive support through this. It's also possible he may feel grief he doesn't know how to deal with - refer him to the leaflet 'Men and Miscarriage' from the Miscarriage Association.
Honour your grieving process - it will take time. You don't need to try to conquer it, just to work through it, with support. Find others to talk to if you feel that would help. The resources above may be able to direct you to groups or counsellors in your area. Find a counsellor or group with specific experience in pregnancy loss, not a generalised spiritual support group.
Remember your baby did not suffer - he or she was not yet developed enough for the nervous system to be connected to the brain. That means he or she did not feel any pain.
And finally - the 'friend' who told you about feeling your baby dead - that's was NOT a friendly or loving thing to do. Look for friends who have a little compassion. Remember - you're not being tested by God - you're processing grief, and that is ok.