For your current process you can use
Process currentProcess = System.Diagnostics.Process.GetCurrentProcess();
long totalBytesOfMemoryUsed = currentProcess.WorkingSet64;
long privateMemory = currentProcess.PrivateMemorySize64;
and
long managedMemory = GC.GetTotalMemory(true);
which will report the amount of allocated managed memory.
Sizing for value types can be done using
var size = sizeof(int);
For an arbitrary object, this is a little more complicated, since it can consist of many smaller objects of indefinite size.
Also see