I personally loved that scene. And I disagree that his protection of Harry was based on completely selfish reasons. I do think Snape cared for Harry in a way, but he was a very tormented man.
Just imagine the emotions that run through him, he sees Harry, the spitting image of the person you loathe most in the world, yet he has the eyes of the woman you loved. He strikes out at Harry because he still has that deepest hatred of James, yet he probably knows deep down that Harry's nature is more like his mother's then his fathers, something which probably makes it harder for Snape to be around Harry. On top of it, when he is a jerk to Harry probably feels guilt for being cruel to Lilly Potter's son, but then he'll get angry at himself for feeling guilty about being hard on a child, because his entire childhood was littered with abuse as well, so him feeling sorry is a sign of weakness. And then the circle continues.
By the end of the book, Snape is shown to be someone who's devoted to protecting Harry, and he's appalled that Dumbledore has apparently raised him like a pig for slaughter. Not only that, but Snape has evolved into a person who does his best to protect others. He attempted to protect Lupin at the beginning of DH, someone he had no fond feelings for, he did his best to keep the children of Hogwarts protected.
And really, it all comes down to the line I posted earlier.
"Don't be shocked Severus, how many men and women have you seen die?"
"Lately, only those whom I could not save."
Snape started out as a very selfish man, and he retained elements of that. But by his death, he had many very noble qualities.