Charge-charge interaction in three-layer systems: Classical approach