Well there are 2 ways of doing it actually.  One is embedding it inside the report itself, but you are limited to using only VB.NET.  The other one is creating a custom code assembly, either in VB.NET or C#, and referencing it from the report.  If you ask me, I prefer the custom code assembly so I can write it in C#.

The following links go through the step by step of adding custom code:

For more information on MSDN, click here.