Praise be to Allaah.
If there is a person who deals in riba (interest/usury), then repents and wants to get rid of the money he gained from riba, it is permissible for him to give it to the poor in order to get rid of it. A person can also do likewise if an amount of riba is put into his account by the bank, but this is not counted as sadaqah (charity), because Allaah is Good and only accepts that which is good and pure. As for continuing to deal in riba, this is not permissible, because it is one of the major sins (kabaa’ir), and taking it is tantamount to challenging Allaah and His Messenger, even if one is dealing in riba in order to give it to the poor.
Sheikh Muhammed Salih Al-Munajjid