1 . Create an empty C# class library
2. Compile you class
Change you target .Net Framework (int unity 5.5.1, it need to be .NET3.5 or lower
then build your project
get back to you project in files, you will get you own dll under path bin/Debug
drop to you unity project
Use dll in unity
Add references of UnityEngine.dlland/orUnityEditor.dllto the project, you can do so by browsing into the folder (typically, depending on your specific Unity3D installation directory):
Mac: /Applications/Unity/Unity.app/Contents/Frameworks/Managed/
Windows: C:\Program Files\Unity\Editor\Data\Managed