What do you mean by manually create the animation in code? Are you trying to build it completely from code rather than describing it in Xaml? Or are you creating the animation in Xaml and then triggering it from code?
Does the animation work if you do it in Xaml rather than in code? Does it work if you animate a non-custom property? Does the dependency property work outside of the animation?
Can you provide a minimal sample of code that demonstrates the problem?
--Rob