You need to use the version that has the "Class" added to the interface name:
open System
[<EntryPoint>]
[<STAThread>]
let main argv =
let oMsg = new CDO.MessageClass()
oMsg.Subject <- "Hello World"
Console.WriteLine(oMsg.Subject)
Console.ReadLine() |> ignore
0
Note: I also explicitly had to add a reference to Microsoft ActiveX Data Objects 6.0 Library
to the project to make the object instantiation work.
In case you want to use the specific interface and not the Co-Class (as proposed by Hans Passant), use this version that casts the created Co-Class to the interface, thereby returning a pointer to the actual interface.
open System
[<EntryPoint>]
[<STAThread>]
let main argv =
let oMsg = upcast new CDO.MessageClass() : CDO.IMessage
oMsg.Subject <- "Hello World"
Console.WriteLine(oMsg.Subject)
Console.ReadLine() |> ignore
0