all you have to do is to #include <stdio.h> and use printf() in your code. For this to work with the debugger console you will have to go to Project options -> Linker -> Output (tab) and in the "Format" section where you have selected "Debug information for C-SPY" you need to have "With I/O emulation modules" checked (this requires "with runtime control modules"). This will make the linker use its special low-level I/O routines (putchar() , getchar() ) which will route it to/from the debug terminal I/O console.
When entering debug mode you get the debug console window displayed by selecting View -> Terminal I/O from the top menu. You will probably notice that if you try to printf too much text it will make the output lag a bit. But it can surely be a handy tool for debugging your application anyway.
(For the curious, you can see in the disassembler that the putchar() / getchar() functions linked into the code when using I/O emulation are just NOP instruction dummy functions. The C-SPY debugger will set a hardware breakpoint in this function, and whenever this breakpoint is reached it will read out the register to read/write the character. The communication overhead causes a small delay for each character. A side-effect of using I/O emulation is that the debugger will reserve one hardware breakpoint for each of these two functions (if you are using them), so you will get fewer hardware breakpoints available to use in your other application debugging.)
You can find some more information about "I/O emulation modules" in the IAR user manual: Help -> 8051 Embedded Workbench User Guide.