Old spelling: The numbers 16 through 19 and 21 through 29 used to be spelled as diez y seis, diez y siete, diez y ocho ... veinte y uno, veinte y dos, etc. You'll still see that spelling sometimes (the pronunciation is the same), but the modern spelling is preferred.
Other notes: Note that y ("and") is not used to separate hundreds from the remainder of the number; thus "one hundred and sixty-one" is not ciento y sesenta y uno but ciento sesenta y uno. Note also that mil is not made plural in numbers above 1,999. Thus 2,000 is dos mil, not dos miles. Also, 1,000 is simply mil, not un mil.
Pronunciation of years: The years in Spanish are pronounced the same as other cardinal numbers are. Thus, for example, the year 2040 would be pronounced as "dos mil cuarenta." The English custom of pronouncing the centuries separately — in English we typically say "twenty forty" instead of "two thousand forty" — is not followed. Saying "veinte cuarenta" instead of "dos mil cuarenta" would strike native Spanish speakers as an anglicism.
Millions and more: Numbers larger than the millions can get problematic in both English and Spanish. Traditionally, a billion has been a thousand million in U.S. English but a million million in British English, and Spanish has followed the British standard, with a trillion being a thousand billions in either case. Thus 1,000,000,000,000 would be a billion in British English but a trillion in U.S. English. Precise Spanish, following the British understanding, uses mil millones for 1,000,000,000 and billón for 1,000,000,000,000, while trillón is 1,000,000,000,000,000. But U.S. English has influenced English outside the U.S. and Spanish as well, especially in Latin America, so there can be confusion both in Latin America and among English speakers outside the United States about exactly what a billion or billón is. To avoid confusion, the Royal Spanish Academy has suggested the use of millardo for 1,000,000,000, although the term has not gained widespread use except in reference to economic issues.