What am I supposed to do if a teammate starts firing at me in World of Tanks?

There is integrated mechanisms to handle these sort of things, and the system knows how to tell the difference between accidental and intentional team damage.

For example, an artillery unit who hits an enemy unit, but simultanously does splash damage to nearby friendly units is not nescesarilly sanctioned, although they will pay a fine to repair the friendly tank. As a frequent arty player, I have accidentally killed friendly unites several times – it sucks, but as long as you don't make it into a pattern, you're cool.

Players who continues to shoot on friendly units, or who shoots a friendly unit immediatly after the battle starts, are marked blue in the list. This carries on over to their next games, and is a warning to the player – if they continue, they will receive sanctions.

The blue status also lets other players know, to look out for this player. If you damage or kill a player that has been marked, you don't receive a fine or penalty to your score:

The system will additionally flag players who have destroyed several allied vehicles over a number of games. The name of such a player will appear blue in your team list. If a player on your team appears as blue – and only then – everyone on your team can attack and destroy that player’s vehicle without a penalty.

You will, however, receive a -1 to your counter. Don't be alarmed by this:

Please note that while you are not penalized for destroying a blue allied vehicle, you also don’t get any credit for doing so – it is basically neutral – however, your counter will still be decreased by one for every allied vehicle destroyed (blue or not).

The system will know which players do team damage and team kills, and will be dealt with automatically. You do not need to report people who do team damage:

A Global Rating system which tracks Friendly Fire from the account over a period of time and a Local Rating system which tracks Friendly Fire within a specific game.

As a result, no reports of friendly fire are required nor are they considered. All tickets sent to the support team to report team killers will be replied stating this information and directed to this post for more information.

However, you can report the player in-game. This is done by Ctrl-clicking the player name, whereafter a context menu shows up. In this, you can choose to report the player. After the battle, you can right-click the player in the battle report to get the same menu.

enter image description here

Read more about the complaint system.
Read more about reporting a player.
Read more about the automated system for registering team damage.