Generating a sine wave from FFT bin
If the transfer function between the mains signal and your contaminated signal is fixed forever, then you could cancel the interference with a sine wave that is locked to the mains, and adjusted in both amplitude and phase to cancel your interference. However, using an fft is not the optimal way to do this, as the true mains frequency will likely fall in between the bins, so you will have a frequency error. A better way is to use a dsp phase-locked loop, the details of which are too complex to describe here. 
However, it is unlikely that the transfer function is fixed. Therefore you will need an adaptive algorithm to adjust the amplitude and phase of your cancellation signal. This adaptive algorithm will look at (input signal - cancellation signal)  and attempt to minimize the portion that is correlated to the mains frequency. Unfortunately the adaptive algorithm will be affected if there is a component in your desired signal that is close to the mains frequency, which will reduce the attenuation of the mains frequency and also add attenuation to the desired signal. So it behaves very much like a notch filter, so you might as well just use a notch filter as RBJ has recommended. 
You can minimize this interference effect by making the adaptive algorithm very slow, but again this is roughly equivalent to using a higher-q notch filter, and both systems will take a long time to settle out.