By initializing 'sum' to 1, you take care of the (1*1) term. Now you need a loop to accumulate +(2*2), -(3*3), +(4*4), etc.. The number itself is represented by i in the loop. If you say sum += i*i; in the loop, that's like saying +(2*2), +(3*3), +(4*4), etc...
You're pretty close to handling how to get the sign to flip on every other term using the pow function. Instead of pow(-1, 1) (which always equals -1) you should say pow(-1, i), which will be +1 if i is an even number and -1 if i is odd. Multiplying this by each term as you go along will effectively flip the sign of each successive term.