As explained the StackOverflow question you link to, How to easily create an Excel UDF with VSTO Add-in project, VSTO does not support the creation of UDFs for Excel. Alternatives for VB.NET are to make COM Automation add-ins as per your other links, or to use something like the free Excel-DNA library (which I develop).
The easiest way to make an Excel UDF with Excel-DNA is to:
- Create a new VB.NET Class Library project in Visual Studio.
- 'Install-Package Excel-DNA' from Nu-Get.
- Add a module with some code, compile and run.
Your first VB.NET function might look like this:
Imports ExcelDna.Integration
Public Module MyFunctions
<ExcelFunction(Description:="My first .NET function")> _
Public Function SayHello(name As String) As String
Return "Hello " & name
End Function
End Module
Then in Excel you enter the UDF as usual:

and press 'Enter' to see the result:

A great guide to porting code from VBA to VB.NET with Excel-DNA is available from Patrick O'Beirne.