If you don't download these files yet, please do it.
And, put the files which I showed below together into some folder.
I changed the file name of ExcelDna.xll and ExcelDna.dna to SimpleExample.xll and SimpleExample.dna.
It is no problem for you to change these names as you like.

Next, Please copy and paste below codes to SimpleExample.dna by notepad or such a editor and save & close dna file.

After compile, you have to modify your ExcelDna.dna file.
Edit this file with notepad like below.

(v4.0 means your version of .NET framework. modify this number if you need)
(If your DLL's relative-path is not "CSLib.dll" from ExcelDNA.xll, you have to correct this name)
(I deployed CSLib.dll, ExcelDna.xll, ExcelDna.dna in the same folder)

After that, double-click your ExcelDna.xll and create new Excel sheet.
As you'll see below, you can use your own function defined in C# language !