I was following this tutorial, but at step 5 I had to import a .dll file in PowerShell:
PS> Import-Module .\bin\Debug\PowerShellModuleInCSharp.dll
Import-Module : The extension '.exe' is not a valid module extension. The supported module extensions are '.dll', '.ps1', '.psm1', '.psd1', '.cdxml' and '.xaml'. Correct the extension then try adding the file 'C:\users\wouter\documents\visual studio`.
No, you weren't following that tutorial. Quoting that tutorial (emphasis mine):
Step 1: Create a Visual Studio project
Within your Visual Studio solution, you will house your cmdlets in a project, just as you would any other component you are building. For PowerShell, create a Class Library project so that once you have built the project, you have a DLL that comprises your PowerShell cmdlets.
The project you created was not a class library project. You appear to have created a Windows Forms Application project instead.
While it's possible to fix this, it involves more than simply changing the project type to "Class Library". The Windows Forms Application project template contains a lot of things you neither need nor should want. It contains references to assemblies you don't want. It contains a form. It contains program start-up code. All of that will remain if you simply change the project type, and you would need to get rid of it manually. It's easier to start over, taking care to follow the steps of the tutorial exactly.