A few travellers have used banks to change money. This is a mistake as the banks will buy your foreign currency at a much lower state rate but will never sell you hard currency at that rate if you are left with the fast devaluing Iranian Rial, in fact the banks never sell hard currencies to anyone let alone foreigners so you lose out if you go to a bank! There are official bureau de changes where you can sell ( and only sometimes buy) your currency at the market rate. You can find them in most city centers as well as international airports. You do not need Iranian Rials to enter Iran, USD and Euros are readily exchangeable in Iran.
Update March 2020
The currency situation is very unstable at the moment. The US dollar has gone up from 42000 Rials to 1 USD in Spring 2019 to over 150000 Rials per 1 USD ( the euro being around 170.000 Rials per 1 euros at the time of this going to the press!!)
The advice is to exchange little by little.
Banks have resumed buying and selling currencies. They are now competing with the bureau de changes, but as the sanctions continue and the economy is still unstable the advise is still to exchange little by little and check the rates. Unfortunately the websites indicating the rates are in Farsi but here is one
http://www.tgju.org/currency