باید یه همچین کاری کنی
using ClassLibrary1;

private void button1_Click(object sender, EventArgs e)
{
class1 test=new class1();
textBox1.Text = test.sum(10, 12).ToString();
}