Frei gave the Swiss team the lead in the 16th minute, heading in a pass from Barnetta. In the 88th, Barnetta added another with a 17-meter (yard) shot off a pass from Mauro Lustrinelli.
Frei missed a chance to score another goal in front of an open net early in the second half.
The win boosted Switzerland's chances of reaching the second round. The team is tied with South Korea at the top of Group G with four points each. France is next with two sports while Togo, which has been eliminated, has zero.
Switzerland is playing at the World Cup for the first time in 12 years. Togo is making its first appearance at the tournament.
The Swiss staged a much faster, more attacking game than their 0-0 draw against France and could have won by a bigger margin, the AP reports.
The Russian missile cruiser Varyag, which is currently staying in the waters of the Mediterranean Sea, blocked the US Navy aircraft carrier strike group in the Adriatic Sea