Our Shaykh, Muḥammad ibn Ḥizām, may Allāh preserve him, was asked the following question:
Question: “The questioner says: ‘a man borrows money from a usurious bank knowing that it is haram. Then he built a house using this money. What does he do with this house now? Is it necessary for him to sell this house and give the money in charity? Or is the house permissible for him?”
Answer: “Allah, the Exalted said:
‘But if you repent, you may have your principal – [thus] you do no wrong, nor are you wronged’ [2:279]
So it is upon him to seek the forgiveness of Allah and repent to Him. Whoever consumes usury, gives it, and cooperates with it, then they enter into the curse.
The Prophet (ﷺ) said, ‘The Messenger of Allah (ﷺ) cursed the one who accepts Ar-Riba (the usury) and the one who pays it’ reported Muslim from Jabir (may Allah be pleased with him)
Something similar was also reported from Ibn Mas’ud (may Allah be pleased with him) also in Muslim. So this man will fall into this Hadith if he does not repent and he will fall into the curse. If he repents, is remorseful for his actions, and resolves not to return to that, then he can remain in this house because the additional amount [i.e. the usury over the principal wealth] is with the bank. Getting rid of usury is only in regards to the additional amount and this additional amount is not with him. He is not the one who is consuming the usury. He does not have the additional amount over the principle such that he can get rid of it. So, [as Allah says] “you may have your principal” and this man did not take an additional amount [over the principal]. So repentance is sufficient for this man and it is upon him to repent with a truthful, sincere repentance.” End. [Reference]
Faisal Ibn Abdul Qaadir Ibn Hassan