Use GetDlgItem to get the hwnd of the control (hWnd is your dialog's hwnd, nIDC is your control's resource id)
HWND hWndCtrl;
::GetDlgItem(hWnd, nIDC, &hWndCtrl);
Use GetWindowText to then get the control's value:
TCHAR szT[64];
::GetWindowText(hWndCtrl, szT, _countof(szT));