The build process for managed CA DLLs is a little complicated becuase of the proxy-wrapper and dll-export requirements. Here's an overview:
Compile your CA assembly, which references Microsoft.Deployment.WindowsInstaller.dll and marks exported custom actions with a CustomActionAttribute.
Package the CA assembly, CustomAction.config, Microsoft.Deployment.WindowsInstaller.dll, and any other dependencies using MakeSfxCA.exe. The filenames of CustomAction.config and Microsoft.Deployment.WindowsInstaller.dll must not be changed, since the custom action proxy specifically looks for those files.
csc.exe /target:library /r:$(DTFbin)\Microsoft.Deployment.WindowsInstaller.dll /out:SampleCAs.dll *.cs
MakeSfxCA.exe $(OutDir)\SampleCAsPackage.dll $(DTFbin)\SfxCA.dll SampleCAs.dll CustomAction.config $(DTFbin)\Microsoft.Deployment.WindowsInstaller.dll
Now the resulting package, SampleCAsPackage.dll, is ready to be inserted into the Binary table of the MSI.
For a working example of building a managed custom action package you can look at included sample ManagedCAs project.