This is from MarthaStewart.com. I HAVE NOT tried it, though.
Coconut Cream Filling
Makes 4 cups
This filling may be made up to one day ahead and kept, tightly covered, in the refrigerator. Use this to fill Coconut Layer Cake.
6 large egg yolks
3/4 cup sugar
6 tablespoons cornstarch
1/8 teaspoon salt
3 cups milk
4 ounces (1 1/2 cups) sweetened angel-flake coconut
1 1/2 teaspoons pure vanilla extract
Unsalted butter, for wrap
Place egg yolks in a large bowl; whisk to combine; set bowl aside.
Combine sugar, cornstarch, and salt in a saucepan. Gradually whisk in milk. Cook, stirring, over medium heat until mixture thickens and comes to a boil, 10 to 12 minutes. Remove from heat.
Whisk 1/2 cup hot milk mixture into the reserved egg yolks to temper. Slowly pour warm yolks into the saucepan, stirring constantly. Cook slowly, stirring, over medium-low heat, until mixture begins to bubble, 5 to 6 minutes. Remove from heat. Stir in coconut and vanilla.
Transfer filling to a medium mixing bowl. Lightly butter a piece of plastic wrap, and lay it directly on top of filling to prevent a skin from forming. Chill until firm, at least 1 hour.