Have you tried the DirectX component sets yet? In case you haven't I highly recommend those. DelphiX for example is not very hard and comes with some great samples. Among those examples, you'll also find the answer to your question.