Thumamah bin Abdullah bin Anas (may Allah have mercy on him) narrates: We were with Sayyiduna Anas bin Malik (may Allah be pleased with him) when a fly fell into a vessel, so Sayyiduna Anas (may Allah be pleased with him) dipped it into the water three times with his finger and said: 'Bismillah' (In the name of Allah), and he said that the Messenger of Allah (peace and blessings be upon him) had ordered them to do just that, and said: "In one of its wings there is disease and in the other there is cure."
Something like it is narrated in Sahih al-Bukhari from Sayyiduna Abu Hurayrah (may Allah be pleased with him).