It might be possible using the .NET framework built in code compiler. I have never done this myself, but i have seen demos of it done with IronRuby, etc. Admittedly they were dynamic languages, but should be possible to do it in C#.
This[
^] article on CodeProject might help.
There is also a calculator example
here[
^].
If the user is able to enter the a ==2 etc, you will have to be very careful checking input to make sure they don't do anything nasty. Not sure how you would go about doing this.