"Had I known that you wanted to read it, I would have returned it immediately."
"If I knew that you wanted to read it, I would have returned it immediately."
Both of these are correct.
"I had known that you wanted to read it, I would have returned it immediately."
This one doesn't work, because the first clause is an indicative statement, not a conditional. In the sentence it's clear that the speaker is trying to get accross that he in fact DIDN'T know that his interlocutor wanted to read it. Since it's something that didn't happen (but WOULD HAVE happened given different conditions), you need to add "if" (if that happened, then blah) or the inversion (had that happened, then blah).
Hope that cleared things up a bit for you.