I earlier posted that
"For Excel - COM using C++
http://shaktisaran.tech.officelive.com/ExcelCOM.aspx
It also has Windows Programming tutorials."
I've deleted that post because it wouldn't help easily.
I'm providing more info related to example on web-site,
In ExcelProcessor.cpp
ReadRange function reads a range of Excel cells but you need to read a cell of data.
ShowAddedCells function writes to an Excel cell which you can use like below.
In ShowAddedCells function,
//Comment the following
/*
DISPID dispidPUT = DISPID_PROPERTYPUT;
DISPPARAMS dparams = {vDblVal, &dispidPUT, 1, 1};
EXCEPINFO excepinfo;
hr = pXlCell->Invoke(dispID,
IID_NULL,
LOCALE_SYSTEM_DEFAULT,
DISPATCH_PROPERTYPUT,
&dparams,
NULL,
&excepinfo,
NULL);
*/
//Add the following
DISPPARAMS dparams = {NULL, NULL, 0, 0};
EXCEPINFO excepinfo;
VARIANT vResult;
VariantInit(&vResult);
hr = pXlCell->Invoke(dispID,
IID_NULL,
LOCALE_SYSTEM_DEFAULT,
DISPATCH_PROPERTYGET,
&dparams,
&vResult,
&excepinfo,
NULL);
//You get the cell value in vResult
So you create a ReadCell function like ShowAddedCells function.