What's the difference between the two? Is dictionary mostly applied to written or printed forms and vocabulary to others (like "someone's active vocabulary")?
They are two different things.
The dictionary is a book (or series of books) that lists all words in alphabetical order with pronunciation, definitions, classifications (noun, verb, adjective) and if it's bilingual (E.G. English-[other language]) it gives the translation.
The vocabulary is not an object, it's that collection of words used in a given language. It can also indicate the amount of words known by a certain person (E.G. John has such a wide vocabulary!).
EDIT: I wrote that lexicon is a synonym of vocabulary, and it is, but Rhodri made me notice that it's also a synonym of dictionary. So I investigated a bit and, as I was suspecting, it has a restricted use, which is still right though... From the OED:
A word-book or dictionary; chiefly applied to a dictionary of Greek, Hebrew, Syriac, or Arabic. The restricted use is due to the fact that until recently dictionaries of these particular languages were usually in Latin, and in mod.L. lexicon, not dictionarius, has been the word generally used.