Duality theory and optimality conditions for Generalized Complementarity Problems