There are two ways. Either you export the variable (there are a few ways to do that) or you assign it as part of the call to tclsh. Using export:
export B="b"
echo 'puts "the B environment variable is $::env(B)"' | tclsh
B="b"
export B
echo 'puts "the B environment variable is $::env(B)"' | tclsh
Assigning as part of the call (NB: no semicolons and the variable assignment is close to the actual call to tclsh):
echo 'puts "the B environment variable is $::env(B)"' | B="b" tclsh
For anything complex or large, try to avoid passing it via environment variables (or command line arguments). Using files works better in those cases. For anything secret, DO NOT use either command line arguments or environment variables as neither is a secure communication mechanism, but files (with appropriate permissions, including on the containing directory) are sufficiently secure.
AtoAon export. If the variable is already defined, justexport Aexports it into the environment. As for Tcl, I do not do Tcl, butputs "A == $::env(A)"seems to have worked for me.export A B C. Then they will be in the child process's environment block regardless of the language.