there's definitely people out there that can give you a better answer
but i know a thing or two:
i only know specifically about open-source and you can read more and
compare the different types of licenses here:
http://developer.kde.org/documentation/licensing/licenses_summary.html
basically there's nothing you can do short of severly compressing/
encrypting/obfuscating your code in order to make it unreadable to
stop people from copying it. if someone does in fact use your
copyrighted material without permission and you catch them you can
take legal action but unless they made millions off your work chances
are you're just wasting your time.
either way my advice is to release everything under an open-source
license and just charge companies for using it.
Alex