I was you in your shoes at one point. My now ex and his ex spoiled my step-daughter. He constantly reminded me I wasn't her mom, wouldn't allow her to call me mom (I wanted her to call me what she felt comfortable with) and didn't want me to discipline her. My hands were tied. Her mom hated me and encouraged her to disobey me (my SD told me.) They both let her have her way no matter what. We actually got along great on our own without her parents, believe it or not, but their influence was all around so I was not allowed to be involved.
After her dad and I separated she went wild, started sneaking out, not going to school, etc. He didn't understand why. Thing is, kids need boundaries to feel secure, I had them, he didn't. She finally turned her life around years later and graduated from high school and became responsible. She told my sister last year her dad didn't love her, but I did, and that she doesn't respect him but does me. And truthfully, I thought she'd hated me. She is very depressed, though, (what a surprise) and attempted suicide. She refused to allow her father to come see her, she wanted me. Who knows where her "mom" is.
What I'm trying to say is that your step-daughter isn't dumb and sees things like they are. She wishes her mom was like you. She hates the way things are so projects her hate onto you. You can't make her not hate you, you can't be her "friend." With your husband not backing you up, all you can do is love her and be there for her if she needs you, even years from now. Don't ignore her, but keep your emotional distance for your sake, stop trying so hard.
What is truly sad is that your husband and everyone else are doing her no good whatsoever. Life is what you make of it, not what it does to you or for you. You have to grow up to find that out, she's never been encouraged to, just coddled.