If I used Mewtwo's "Barrier" attack last turn and this turn I play Pokemon Ranger, does that clear the effect so I can use "Barrier" again this turn?
No, Barrier does not "place an effect" to prevent its use on the next turn (unlike attacks such as "Volcanic Heat" which says "this Pokemon" cannot attack next turn). Instead, the attack does a Game State check to see if it was used last turn. Since there is no effect to clear, Pokemon Ranger won't allow you to use Barrier two turns in a row.
Source: TPCi Rules Team (2016-11-03), TPCi Rules Team (2016-12-01)
If my Mewtwo attacked with "Barrier" last turn, and this turn I retreat it and use Switch to make it active again, can I attack with "Barrier" again?
No. The prohibition against using Barrier if it was used last turn is not an effect, it is a Game State check. So it can't be cleared by moving Mewtwo to the bench.
Source: Evolutions FAQ (2016-11-03), TPCi Rules Team (2016-11-03)