I am interested in learning the theory of types, especially in how they can provide a foundation to mathematics different to sets and how they can avoid selfreferential paradoxes by stipulating that a collection of objects of type n has type n+1. As for my background knowledge, I only know a little of propositional and predicate logic and ZermeloFraenkel set theory.
I would suggest you look at MartinLöf's work, such as the following reprint of his earlier unpublished manuscript (from 1972?):
I belive a fairly good approximation of this paper is available online. If you are looking for other online references, have a look at this lecture by MartinLöf. This should give you some idea for type theory as foundation of mathematics. 


The kind of type theory you're asking about, Russell's simple theory of types, is from about the early 1900's. Here's a reference:
Recent work in type theory is somewhat different, continuing the tradition of Per MartinLöf. In addition to his work (referenced by Andrej), I would also recommend the following book by Luo:
For the relation between set theory, type theory, and category theory, you might want to have a look at this preprint by Steve Awodey. There's also an nlab page, and the type theory page at Stanford Encyclopedia of Philosophy has a reference section. 


In terms of modern type theory, you might be best off playing around with Coq; this will give you instant feedback on any misconceptions you might have about how things work. The book Coq'Art (linked from the Coq website) is quite good and the system hasn't changed too much since the book was written. 


I found this a valuable and concise introduction:


