Veja se é isso que deseja.
crie um projeto windows console na sua solution, e tente usar o código para ver o resultado.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Totalizador
{
class Program
{
static void Main(string[] args)
{
string opcao1 = string.Empty;
int total = 0;
while (opcao1 != "SAIR" )
{
Console.Write("preencher o valor para somar: ");
opcao1 = Console.ReadLine();
int myInt;
if (int.TryParse(opcao1, out myInt))
{
Teste Calc = new Teste();
Console.WriteLine("TOTAL PARCIAL : " + Calc.Somar(Convert.ToInt32(opcao1), ref total));
Console.WriteLine("---");
}
}
}
}
class Teste
{
public int Somar(int val1, ref int total )
{
total += val1;
return total;
}
}
}
Se foi útil, por favor não esquece de pontuar a resposta.