AC Power measureless using MCU, calculations problems
As you say, instantaneous power is the product of the instantaneous voltage and current.  Average power is simply that averaged over time.  Note that the instantaneous power can be both positive and negative.

To get a reasonable average, you want eliminate the 50 or 60 Hz components.  One way to do this is to keep a running average over whole line cycles.  This will be easier if you look at the voltage zero crossings and average all the values between one and the next.  You could then additionally low pass filter those readings a bit to reduce random noise and to make the result more smooth.

Another way that doesn't rely on detecting individual power line cycles is to heavily low pass filter the instantaneous power values so that 50 Hz is attenuated to the point you don't care.  That of course will work at least as well with 60 Hz then too.  Let's say you are sampling the voltage and current at 10 kHz rate, which is 200 readings per 50 Hz line cycle.  3 poles of low pass filtering with a filter fraction of 1/1024 should do it.  That assumes each pole follows the algorithm:

FILT &lt;-- FILT + FF(NEW - FILT)

where FF is the filter fraction.  Note that the multiply by FF is then really accomplished by a right shift of 10 bits, which is easy to do in a microcontroller.  The step response of that filter is .1% after 200 iterations, or one 50 Hz line cycle.  The step response after 5000 iterations, or 1/2 second, is 87%.  That is about right for displaying to a human observer.