The Gemara quotes the verse כל אשר לא יבא באש תעבירו במים וטהר – “any utensil which cannot withstand koshering through fire must be passed through water”. The Gemara derives that all utensils bought from a non-Jew must have a ritual immersion – tevila – prior to using it. Rashi writes that tevilat keilim is a biblical commandment, and this is the general consensus of most poskim.
The Rambam writes that tevilat keilim are divrei sofrim. The Ran explains that this means that the laws of tevilat keilim are rabbinic in nature. However, the Aruch Hashulchan writes that when the Rambam writes that a halacha is divrei sofrim, he merely means that it is a biblical commandment which was given over orally to Moshe Rabbeinu, and is not written explicitly in the Torah. The Aruch Hashulchan rules that even according to the Rambam, tevilat keilim is a biblical commandment.
The Yerushalmi tells us that the reason for the commandment of tevilat keilim is to elevate the utensils from their lower state when they belonged to a non-Jewish owner to the elevated status and purity of a utensil with a Jewish owner. The Rishonim add that this is similar to the process of conversion. Just like a non-Jew who converts to Judaism must immerse himself to elevate himself to the status of a Jew, so too, through the immersion of a utensil, the utensil is elevated and becomes become holier.
Using Utensils Prior to Tevila
One may not use a utensil bought from a non-Jew prior to immersing it in a kosher mikvah. There is a dispute among the poskim whether this is a biblical prohibition or a rabbinic prohibition.
 עבודה זרה עה:
 שם ד”ה זוזא
 ט”ז יו”ד סי’ קכ ס”ק טז, ערה”ש שם סעי’ ד
 הל’ מאכ”א פי”ז הל’ ה
 עבודה זרה עה:
 ערה”ש יו”ד סי’ קכ סעי’ ד
 עבודה זרה פרק ה הל’ טו
 שו”ע יו”ד סי’ קכ סעי’ א
 פמ”ג או”ח סי’ תפו מש”ז ריש סעי’ א
 ביאור הלכה סי’ שכג סעי’ ז