Can anyone explain the difference between unmanaged code and managed code?
This is not a SharePoint question, but anyways, here's a real quick intro:
Unmanaged code: This is code that is compiled directly to machine code using native languages (C++, VB etc). The reason it is called unmanaged code is that your application is responsible for resource management (memory, handles etc). This is typically what we call a Win32 application.
Managed code: Managed code are code compiled to an intermediate byte code, which (normally) during runtime are JIT (Just In Time) compiled into machine code. The reason it is called managed code is that it has built-in functionality for memory management and garbage collection. This is what the Microsoft .NET Framework is (or Java for that matter).