How can I forbid dll class library to be referenced in other solutions?
You can make some dll class methods to fail if it is not used by your own main program.
Assembly main = System.Reflection.Assembly.GetExecutingAssembly();
if (main.FullName != .....)
throw new NotSupportedException();
or
if (IsSignedWith(main, myCompanysX509Certificate))
throw new NotSupportedException();