Dumbledore trusted Snape. While Rowling led the reader to believe he was evil, we find out in the seventh and final book, that he is indeed of sound character. He ends up being the namesake of one of Harry and Ginny's children. Dumbledore had ordered Snape to kill him and Snape did so only because Dumbledore made him. He loved and helped Harry in the last book. He was definitely good by the end of the series.
Remember though Snape was still unpleasant to other characters. He wasnt all good, while one of the best characters in the series he was still a bully to characters like Neville. His actions were heroic and good but his attitude to others was not.