You ask, "Do professors like it when you use them as a reference or should I avoid it?"

Aside from that. . . I would think the danger of using your professor's work as a reference in something he's going to grade has little to do with ego-boosting. It's the fact that the prof knows his own work better than anyone else's, and may be exquisitely sensitive to any sign that you're not interpreting his work in the way that he meant it. You might misunderstand his work. Or you might understand it fine, but not know the subtle hermeneutical nuances of meaning that exist more in the prof's mind than in the words on the page. What you get out of the paper might not be what the prof put into it, or thought he was putting into it. So be careful -- but I see no reason to cite, or not to cite, your prof's work just because his ego might be stroked.