Here is a graphic that defines a veering and a backing wind.
For an observer facing into wind as showing in the diagram, the wind is said to back if the observer has to turn "anticlockwise" to remain facing into wind. Conversely, the wind is said to veer if the same observer has to turn "clockwise" to remain facing into wind.
Notwithstanding the above, there is no requirement to face into the wind to work out if the wind is backing or veering. In the above diagram, the observer could be standing with his/her back to the wind. If the observer has to turn anticlockwise to maintain the wind on his/her back the wind is backing and vice versa.
Think of the wind velocity as the big hand of an old style analogue clock that points to the center of the clock face - assume that this clock has no little hand. If the hand moves anticlockwise on climb after takeoff the winds are said to back with altitude. Similarly on landing soon after takeoff the winds will veer on descent to land and the big hand will move clockwise back to its original direction.
Eg: If the Surface wind is 360M and the gradient wind is 300M the winds will back on departure (ie back with altitude) and veer on arrival (ie veer on descent). It all depends on how you look at it.